home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 30 / PC Gamer IT CD 30 1-2.iso / MOTS / GAMEDATA / RESOURCE / JKMRES.GOO / cog_pow_scope_m.cog < prev    next >
Text File  |  1998-02-25  |  2KB  |  90 lines

  1. # Jedi Knight Missions Cog Script
  2. #
  3. # POW_SCOPE_M.COG
  4. #
  5. # POWERUP Script - Stormtrooper rifle scope pickup
  6. #
  7. # [YB, CYW & RF]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10.  
  11.  
  12. symbols
  13.  
  14. thing       powerup                          local
  15. thing       player                           local
  16. int         bin=13                           local
  17. sound       pickupsnd=thrmlpu2.wav           local
  18. sound       respawnsnd=Activate01.wav        local
  19. flex        amount                           local
  20.  
  21. int         autopickup=0                     local
  22.  
  23. message     touched
  24. message     taken
  25. message     respawn
  26.  
  27. end
  28.  
  29. # ========================================================================================
  30.  
  31. code
  32.  
  33. touched:
  34.    player = GetSourceRef();
  35.  
  36.    if (GetThingType(player) == 10)  // Can only be taken by players.
  37.    {
  38.       amount = GetInv(player, GetWeaponBin(bin));
  39.  
  40.       if(IsMulti() || (amount < GetInvMax(player, GetWeaponBin(bin))))
  41.       {
  42.          TakeItem(GetSenderRef(), -1);
  43.          call taken;
  44.       }
  45.    }
  46.  
  47.    Return;
  48.  
  49. # ........................................................................................
  50.  
  51. taken:
  52.    player = GetSourceRef();
  53.    powerup = GetSenderRef();
  54.  
  55.    // Print("Scope");
  56.    jkPrintUNIString(player, GetWeaponBin(bin));
  57.  
  58.    // Do effects.
  59.    PlaySoundLocal(pickupsnd, 1, 0, 0);
  60.    AddDynamicTint(player, 0.0, 0.0, 0.2);
  61.  
  62.    // Increment powerup amount.
  63.    SetInv(player, GetWeaponBin(bin), 1.0);
  64.  
  65.    // Check for Auto Pickup
  66.  
  67.       // Auto pickup if the player is Kyle and this is not multi player.
  68.    if ((!IsMulti()) && (GetInv(player, 67) == 0.0))
  69.    {
  70. //      autopickup = GetAutoPickup();
  71. //      if(autopickup & 1)
  72.       {
  73. //         if(!((autopickup & 4) && (GetWeaponPriority(player, GetCurWeapon(player), 0) >= GetWeaponPriority(player, bin, 0))))
  74.          {
  75.             SelectWeapon(player, GetWeaponBin(bin));
  76.          }
  77.       }
  78.    }
  79.  
  80.    Return;
  81.  
  82. # ........................................................................................
  83.  
  84. respawn:
  85.    PlaySoundThingLocal(respawnsnd, GetSenderRef(), 0.6, 5.0, 10.0, 0);
  86.  
  87.    Return;
  88.  
  89. end
  90.